<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>平移效果</title>
    <style>
        div {
            width: 300px;
            height: 300px;
            background-color: yellowgreen;
            margin: 0 auto;
        }

        div:hover {
            transform: translate(300px,300px);
            transition: all 3s;
            cursor: pointer
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>